package com.neusoft.yuejian12.yuejian_12.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.neusoft.yuejian12.yuejian_12.R;
import com.squareup.picasso.Picasso;

import static com.neusoft.yuejian12.yuejian_12.R.id.c_pic;

public class ClubDetailActivity extends AppCompatActivity {
    private ImageView left;
    private ImageView collect;
    private ImageView c_pic;
    private TextView c_name;
    private TextView c_address;
    private TextView c_time;
    private TextView c_info;
    private TextView c_phone;
    private int c_id;
    private int flag;

    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_club_detail);
        initView();
        getClubData();
        initEvent();
        // isBeCollected();
    }

    private void initView() {

        collect = (ImageView) findViewById(R.id.collect);
        left = (ImageView) findViewById(R.id.left);
        c_name = (TextView) findViewById(R.id.c_name);
        c_address = (TextView) findViewById(R.id.c_address);
        c_time = (TextView) findViewById(R.id.c_time);
        c_info = (TextView) findViewById(R.id.c_info);
        c_phone = (TextView) findViewById(R.id.c_phone);
        c_pic = (ImageView) findViewById(R.id.c_pic);
    }
    private void initEvent(){
        left.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view) {
                finish();
            }
        });
 }
    private void getClubData() {
        Bundle bundle = this.getIntent().getExtras();
        String cname = bundle.getString("c_name");
        String caddress = bundle.getString("c_address");
        String cphone = bundle.getString("c_phone");
        String cinfo = bundle.getString("c_info");
        // int tprice = bundle.getInt("t_price");
        String cpic = "http://10.0.2.2:888/yuejian14/Public/Admin/clubphoto/" + bundle.getString("c_pic");
        String ctime = bundle.getString("c_time");
        c_name.setText(cname);
        c_address.setText(caddress);
        c_phone.setText(cphone);
        c_info.setText(cinfo);
        c_time.setText(ctime);
        Picasso.with(this).load(cpic).into(c_pic);
    }
}